# include<stdio.h>
# include<graphics.h>
# include<conio.h>
# include<string.h>
# include<time.h>
# include"myEasyXUtils.h"
# include"clockPaintMethods.h"
int main()
{
	int digitalClockWidth = 640, digitalClockHeight = 320;
	int clockOuterBorderThickness = 10;
	int clockInnerBorderThickness=20;
	int betweenOuterBorderAndInnerBorder = 40;
	int clockOuterThickness = clockOuterBorderThickness + betweenOuterBorderAndInnerBorder;
	int clockBeforeInner = clockOuterThickness + clockInnerBorderThickness / 2;
	int clockBeforeContent = clockOuterThickness + clockInnerBorderThickness;
	int heightAlloToTime = 200;
	int heightAlloToDate = 60;
	int heightAlloToSpare = 40;
	COLORREF bkColor = WHITE;
	COLORREF clockOuterBorderColor = CYAN;
	COLORREF clockBetweenOuterBorderAndInnerBorderColor = RED;
	COLORREF clockInnerBorderColor = YELLOW;
	COLORREF clockContentColor = RGB(241, 241, 241);
	SYSTEMTIME systime;
	initgraph(digitalClockWidth,digitalClockHeight);
	setbkcolor(bkColor);
	cleardevice();
	BeginBatchDraw();
	paintClockOuterBorder(digitalClockWidth,digitalClockHeight,clockOuterBorderColor,clockOuterBorderThickness);
	paintClockBetweenOuterBorderAndInnerBorder(clockBetweenOuterBorderAndInnerBorderColor,betweenOuterBorderAndInnerBorder, clockOuterBorderThickness, digitalClockWidth, digitalClockHeight, bkColor);
	paintClockInnerBorder(digitalClockWidth, digitalClockHeight, clockInnerBorderColor, clockOuterThickness, clockInnerBorderThickness);
	while (1) 
	{
		BeginBatchDraw();
		paintClockInnerContent(digitalClockWidth, digitalClockHeight, clockBeforeInner, clockContentColor);
		GetLocalTime(&systime);
		paintClockTime(systime.wHour, systime.wMinute, systime.wSecond, clockBeforeContent, clockBeforeContent, digitalClockWidth - clockBeforeContent, digitalClockHeight - clockBeforeContent - heightAlloToSpare - heightAlloToDate / 4);
		paintClockDate(systime.wYear, systime.wMonth, systime.wDay, clockBeforeContent, clockBeforeContent + heightAlloToSpare + heightAlloToTime / 3, digitalClockWidth - clockBeforeContent, digitalClockHeight - clockBeforeContent);
		FlushBatchDraw();
	}
	EndBatchDraw();
	return 0;
}